@import 'fonts.scss';

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  --primary: #70a480;
  --dark: #0a0a0a;
  --slash: #45cbde;
}

html {
  overflow-y: auto !important;
}

body {
  margin: 0;
  background-color: var(--dark);
  min-height: 100vh;
  color: #fff;
  font-weight: 500;
  font-family: 'Kanit';
}

.background-text {
  position: absolute;
  top: 0;
  left: 0;
  opacity: 0.65;
  z-index: -1;
  margin: 0;
  width: 100vw;
  height: 100vh;
  object-fit: cover;
  -webkit-user-drag: none;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
}

.v-slide-group__next,
.v-slide-group__prev {
  display: none !important;
}

.v-toolbar__content {
  justify-content: space-between;
}

.v-card,
.v-tab,
.v-field__overlay,
.v-select__content {
  border-radius: 0 !important;
}

.v-input__details {
  display: none;
}

.v-selection-control__input {
  font-size: 1.25em;
}

.v-label {
  opacity: 1;
}

.added-score,
.added-health {
  position: absolute;
  top: 50%;
  right: -5px;
  transform: translate(150%, -50%);
  animation: added-score-fadeout 1200ms ease forwards;
  color: var(--primary);
  font-weight: 700;
}

.added-health {
  right: -15px !important;
  color: red !important;
}

@keyframes added-score-fadeout {
  0%,
  10% {
    transform: translate(150%, -50%);
    opacity: 1;
    color: var(--primary);
  }
  100% {
    transform: translate(150%, -130%);
    opacity: 0;
    color: #fff;
  }
}

///////

@mixin no-drag {
  -webkit-user-drag: none;
  user-drag: none;
  -moz-user-select: none;
  -webkit-user-select: none;
  user-select: none;
}

.page {
  &.overlay {
    position: absolute;
    top: 0;
    left: 0;
    transform: translateY(-100%);
    z-index: 1000;
    animation: overlay-down 300ms ease forwards;
    background-color: var(--dark);
    width: 100%;
    height: 100%;
  }

  &.hide.overlay {
    transform: translateY(0);
    animation: overlay-up 300ms ease forwards;
  }

  &.hide:not(.overlay) {
    display: none;
  }

  @keyframes overlay-down {
    0% {
      transform: translateY(-100%);
    }
    100% {
      transform: translateY(0);
    }
  }

  @keyframes overlay-up {
    0% {
      transform: translateY(0);
    }
    100% {
      transform: translateY(-100%);
    }
  }

  .navbar {
    padding: 20px 30px;
    .nav-logo {
      display: block;
      height: 180px;
      @include no-drag;
    }

    @media (max-width: 768px) {
      display: flex;
      justify-content: center;
      align-items: center;
      padding: 20px;

      .nav-logo {
        height: 130px;
      }
    }
  }

  h1 {
    font-weight: 400;
    font-size: 64px;
    font-family: 'Bree serif';
    letter-spacing: 10px;
    @include no-drag;

    @media (max-width: 570px) {
      font-size: 42px;
      letter-spacing: 5px;
    }
  }

  .motto {
    color: var(--primary);
    font-size: 24px;
    @include no-drag;
  }

  .container {
    margin-top: -40px;
    margin-right: auto;
    margin-left: auto;
    width: 100%;
    max-width: 1000px;
    text-align: center;

    @media (max-width: 768px) {
      margin-top: 0;
    }
  }

  .btn-container {
    margin-top: 80px;
  }

  .how-play {
    margin-top: 100px;

    h2 {
      font-size: 24px;
    }

    .list {
      display: flex;
      flex-wrap: wrap;
      justify-content: center;
      gap: 40px;
      margin-top: 20px;
      padding: 0 15px;

      .item {
        max-width: 150px;

        .ico {
          display: flex;
          justify-content: center;
          align-items: center;
          margin-bottom: 16px;
          border-radius: 50%;
          background-color: #000;
          padding: 10px;
          width: 150px;
          height: 150px;
          @include no-drag;
        }
      }
    }
  }

  .leaderboard-container {
    position: absolute;
    top: 50%;
    right: 30px;
    transform: translateY(-50%);

    @media (max-width: 1200px) {
      display: flex;
      position: unset;
      flex-direction: column;
      align-items: center;
      gap: 10px;
      transform: none;
      padding: 40px 0 20px;
    }
  }
}

.github-corner:hover .octo-arm {
  animation: octocat-wave 560ms ease-in-out;
}

@keyframes octocat-wave {
  0%,
  100% {
    transform: rotate(0);
  }
  20%,
  60% {
    transform: rotate(-25deg);
  }
  40%,
  80% {
    transform: rotate(10deg);
  }
}

@media (max-width: 500px) {
  .github-corner:hover .octo-arm {
    animation: none;
  }
  .github-corner .octo-arm {
    animation: octocat-wave 560ms ease-in-out;
  }
}

.btn-slash {
  position: relative;
  z-index: 2;
  transition:
    color 300ms ease 250ms,
    transform 120ms ease;
  cursor: pointer;
  outline: none;
  box-shadow: inset 0 0 0 4px #fff;
  border: 0;
  background-color: transparent;
  padding: 24px 60px;
  min-width: 280px;
  color: #000;
  font-weight: 500;
  font-size: 20px;
  font-family: 'Kanit';

  &.click {
    transform: scale(0.95);
  }

  .bg {
    position: absolute;
    top: 0;
    left: 0;
    z-index: -2;
    width: 100%;
    height: 100%;
  }

  .bg::before,
  .bg::after {
    display: block;
    position: absolute;
    left: 0;
    transition: all 300ms ease;
    transition-delay: 200ms;
    background-color: #fff;
    width: 100%;
    content: '';
  }

  .bg::before {
    top: 0;
    bottom: 50%;
  }

  .bg::after {
    top: 50%;
    bottom: 0;
  }

  &.alt {
    transition: background-color 150ms ease-out;
    box-shadow: inset 0 0 0 3px #aaa;
    color: #aaa;

    .bg::before,
    .bg::after {
      display: none;
    }

    &:hover {
      background-color: rgba(#fff, 0.1);
    }
  }

  &:hover {
    color: #fff;

    .bg::before {
      bottom: 100%;
    }

    .bg::after {
      top: 100%;
    }
  }

  .slash {
    position: absolute;
    top: 50%;
    left: -30px;
    transform: translateY(-50%);
    opacity: 0;
    box-shadow: 0 0 3px 0 #000;
    border-radius: 50px;
    background-color: #e0e0e0;
    width: 2px;
    height: 2px;

    &.anim {
      opacity: 1;
      animation: btn-slash 400ms ease forwards;
    }
  }
}

@media (max-width: 768px) {
  .btn-slash {
    padding: 16px 24px;
  }
}

@keyframes btn-slash {
  0% {
    width: 2px;
  }
  50% {
    left: -30px;
    width: calc(100% + 60px);
  }
  100% {
    left: calc(100% + 30px);
    width: 0px;
  }
}
